<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var fru = prompt('输入你想要的水果');
        switch (fru) {
            case '苹果':
                alert('3.5元一斤');
                break;
            case '榴莲':
                alert('35元一斤');
                break;
            default:
                alert('没有!');
        }
    </script>
</head>

<body>

</body>

</html>